<style>
    .layui-form-label {
        width: 80px !important;
    }

    .layui-input-block {
        margin-left: 120px;
    }

    .hover {
        cursor: pointer;
    }
</style>
<div class="rc-pagepadding ">
    <div class=" rc-pannel rc-pagepadding">
        <div class=" rc-pannel-header rc-pagepadding rc-bold">
            <i class="iconfont goback rc-pointer">&#xe62b;</i> 添加支付通道
        </div>
        <div class="rc-pannel-body layui-form  rc-pagepadding">
            <div class="layui-form-item">
                <label class="layui-form-label">通道名</label>
                <div class="layui-input-block">
                    <input type="input" name="title" id="title" lay-verify="required" class="layui-input">
                </div>

            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">支付扩展</label>
                <div class="layui-input-block">
                    <table class="layui-table">
                        <colgroup>
                            <col>
                            <col>

                        </colgroup>
                        <thead>
                            <tr>
                                <th>支付扩展</th>
                                <th>原路退款扩展 <i class="layui-icon layui-icon-question rc-tips rc-pointer" message=""></i></th>
                            </tr>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                </div>

            </div>

            <div class="layui-form-item rc-margin-bottom0">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit lay-filter="submit">提交</button>
                    <button type="reset" class="layui-btn layui-btn-sm">重置</button>
                </div>
            </div>
        </div>
    </div>

    <script>
        layui.use(function() {
            var form = layui.form;




            form.on('submit(submit)', function(data) {
                $.ajax({
                    url: '/admin/cnf/Message/addChannel', //请求路径
                    type: "POST", //请求方式
                    data: data.field, // 默认写法
                    success: function(data) {
                        if (data.code == 0) {
                            toastr_success("添加成功", function() {
                                window.location.href = '/admin/cnf/Message/channels';
                            });

                        } else {
                            toastr_error(data.message);
                        }
                    },
                    error: function() {

                    },

                });
            });

        });
    </script>